export function formatDate(timeStamp, format="Y-M-D h:m:s") {
    let Time = new Date(timeStamp)
    let Year = Time.getFullYear()
    let Month = Time.getMonth() < 9 ? `0${Time.getMonth() + 1}` : (Time.getMonth() + 1)
    let date = Time.getDate() < 10 ? `0${Time.getDate()}` : Time.getDate()
    let hour = Time.getHours() < 10 ? `0${Time.getHours()}` : Time.getHours()
    let minutes = Time.getMinutes() < 10 ? `0${Time.getMinutes()}` : Time.getMinutes()
    let seconds = Time.getSeconds() < 10 ? `0${Time.getSeconds()}` : Time.getSeconds()
    let time = format.replace('Y', Year).replace('M', Month).replace('D', date).replace('h', hour).replace('m', minutes).replace('s', seconds)
    return time
}